<!--#include file="conn.asp"-->
<%
'这个页面的作用就是自动生成一条本机ip的临时记录
'同时当用户扫描后access_token.asp会记录下openid

dim openid
ip=request.ServerVariables("REMOTE_ADDR")
create_time=now()

set rs=server.CreateObject("adodb.recordset")
sql="select * from userinfo where ip='"& ip &"'"
rs.open sql,conn
if rs.eof then	
	rs.close
	sql="insert into userinfo(ip,create_time) values('"& ip &"','"& create_time &"')"
	rs.open sql,conn		
else

openid=rs("openid")
token=rs("access_token")
login_state=rs("login_state")

if openid <>"" and token <>"" and login_state = "1" then
resText=openid&":"&token
end if

end if

rs.close
set rs=nothing

%>
<%=resText%>
